package io.github.maojian.arr;

import org.junit.Test;

/**
 * @Auther: jian.mao
 * @Date: 2022/4/14 13:03
 * @Description:
 */
public class Q1672 {
    public int maximumWealth(int[][] accounts) {
        int count = 0, curCount = 0;
        int[] curAccount;
        for (int i = 0; i < accounts.length; i++) {
            curAccount = accounts[i];
            for (int j = 0; j < curAccount.length; j++) {
                curCount += curAccount[j];
            }
            count = Math.max(count, curCount);
            curCount = 0;
        }
        return count;
    }

    @Test
    public void test() {
        int[][] accounts = new int[][]{{2, 8, 7}, {7, 1, 3}};
        System.out.println(maximumWealth(accounts));
    }
}
